package com.count.rule;

import com.count.number.SpecialNumber;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: ZhongGang
 * Date: 14-5-4
 * Time: 下午2:51
 */
public class ContainFirstSpecialNumberRule implements SpecialNumberRule {

    @Override
    public String count(Integer number, List<SpecialNumber> specialNumbers) {
        SpecialNumber firstSpecialNumber = specialNumbers.get(0);
        if (number.toString().contains(firstSpecialNumber.getNumber().toString())) {
            return firstSpecialNumber.getWord();
        }

        return null;
    }
}
